import Vue from 'vue'
import Router from 'vue-router'

// 后台系统
import login from '@/components/page/system_management/login'




const index = ()=>import('@/components/page/system_management/index.vue') 
const workBench = ()=>import('@/components/page/system_management/workBench.vue') 
const student = ()=>import('@/components/page/system_management/student.vue') 
const dataPage = ()=>import('@/components/page/system_management/dataPage.vue') 
const daily = ()=>import('@/components/page/system_management/daily.vue') 


const studentDetail = ()=>import('@/components/page/system_management/studentDetail.vue') 
const followDetail = ()=>import('@/components/page/system_management/followDetail.vue') 
const tagDetail = ()=>import('@/components/page/system_management/tagDetail.vue') 
const addStudent = ()=>import('@/components/page/system_management/addStudent.vue') 
const studentAllocation = ()=>import('@/components/page/system_management/studentAllocation.vue') 
const followList = ()=>import('@/components/page/system_management/followList.vue') 
const auditionList = ()=>import('@/components/page/system_management/auditionList.vue') 
const addAudition = ()=>import('@/components/page/system_management/addAudition.vue') 
const marketChannel = ()=>import('@/components/page/system_management/marketChannel.vue') 

const personCenter = ()=>import('@/components/page/system_management/personCenter.vue') 
const targetTracking = ()=>import('@/components/page/system_management/targetTracking.vue') 
const homeData = ()=>import('@/components/page/system_management/homeData.vue') 



// 协议页面

Vue.use(Router)


export default new Router({
  routes: [{
      path: '/',
      redirect: '/login'
    }, 
    {
      path: '/login',
      name: 'login',
      component: login
    }, 
    
    {
      path: '/home',
      name: 'index',
      component: index,
      children: [
        {
          path: '/workBench',
          name: 'workBench',
          component: workBench,
          meta: {
            level: 1,
            title: '工作台'
          }
        },
        {
          path: '/student',
          name: 'student',
          component: student,
          meta: {
            level: 1,
            title: '学员',
            rightIcon: 'screen'
          }
        },
        {
          path: '/dataPage',
          name: 'dataPage',
          component: dataPage,
          meta: {
            level: 2,
            title: '数据'
          }
        },
        {
          path: '/daily',
          name: 'daily',
          component: daily,
          meta: {
            level: 1,
            title: '日常'
          }
        },
        {
          path: '/studentDetail/:id',
          name: 'studentDetail',
          component: studentDetail,
          meta: {
            level: 2,
            title: '学员详情'
          }
        },
        {
          path: '/followDetail/:id',
          name: 'followDetail',
          component: followDetail,
          meta: {
            level: 2,
            title: '跟进记录',
            rightIcon: 'setting'
          }
        },
        {
          path: '/tagDetail/:id',
          name: 'tagDetail',
          component: tagDetail,
          meta: {
            level: 2,
            title: '添加标签',
            rightIcon: 'complete'
          }
        },
        {
          path: '/addStudent',
          name: 'addStudent',
          component: addStudent,
          meta: {
            level: 2,
            title: '添加学员',
            rightIcon: '保存'
          }
        },
        {
          path: '/studentAllocation',
          name: 'studentAllocation',
          component: studentAllocation,
          meta: {
            level: 2,
            title: '学员分配',
            rightIcon: 'screen'
          }
        },
        {
          path: '/followList',
          name: 'followList',
          component: followList,
          meta: {
            level: 2,
            title: '学员跟进',
            rightIcon: 'screen'
          }
        },
        {
          path: '/auditionList',
          name: 'auditionList',
          component: auditionList,
          meta: {
            level: 2,
            title: '试听课管理',
            rightIcon: 'screen'
          }
        },
        {
          path: '/addAudition',
          name: 'addAudition',
          component: addAudition,
          meta: {
            level: 2,
            title: '',
            rightIcon: '保存'
          }
        },
        {
          path: '/marketChannel',
          name: 'marketChannel',
          component: marketChannel,
          meta: {
            level: 2,
            title: '市场渠道',
            rightIcon: 'add'
          }
        },
        {
          path: '/personCenter/:id',
          name: 'personCenter',
          component: personCenter,
          meta: {
            level: 2,
            title: '个人中心',
          }
        },
        {
          path: '/targetTracking',
          name: 'targetTracking',
          component: targetTracking,
          meta: {
            level: 2,
            title: '月度目标追踪',
            rightIcon: 'screen'
          }
        },
        {
          path: '/homeData',
          name: 'homeData',
          component: homeData,
          meta: {
            level: 2,
            title: '经营一览',
            // rightIcon: 'screen'
          }
        },

        
      ]
    },
    
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
